from typing import Optional
from fastapi import FastAPI, APIRouter
from pydantic import BaseModel
from datetime import datetime, time, timedelta

app = FastAPI()

@app.get("/")
async def root():
    return {"Hello": "World!"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = None):
    return {"item_id": item_id, "q": q}

@app.get("/code/{code_id}")
def read_code(code_id: str):
    return {"code": code_id}

if __name__ == '__main__':
    pass